package com.pikaqiu.warehouse.controller;

import com.pikaqiu.warehouse.domain.common.MiniAjaxResult;
import com.pikaqiu.warehouse.domain.dto.SpecialUserDto;
import com.pikaqiu.warehouse.domain.req.SpecialUserForm;
import com.pikaqiu.warehouse.service.EmployeeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: Administrator
 * @Date: 2024/8/18
 */
@RestController
@RequestMapping("/employee")
public class EmployeeController {

    @Resource
    private EmployeeService employeeService;

    @GetMapping("/list")
    public MiniAjaxResult<List<SpecialUserDto>> listCompanyEmployee() {
        return MiniAjaxResult.success(employeeService.listCompanyEmployee());
    }

    @PostMapping("/save")
    public MiniAjaxResult<String> saveEmployee(SpecialUserForm specialUserForm) {
        employeeService.saveEmployee(specialUserForm);
        return MiniAjaxResult.success();
    }
}
